package com.sop.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sop.dao.PeopleRoleDao;
import com.sop.model.PeopleRole;
import com.sop.model.RoleInfo;
import com.sop.model.vo.PeopleRoleVo;
import com.sop.service.PeopleRoleService;

import common.base.service.BaseServiceImpl;

@Service("peopleRoleService")
@Transactional
public class PeopleRoleServiceImpl extends BaseServiceImpl<PeopleRole,PeopleRoleVo> implements PeopleRoleService{

	@Autowired
	private  PeopleRoleDao  peopleRoleDao;
	
	@Resource(name="peopleRoleDao")
	public void setBaseDao(PeopleRoleDao  peopleRoleDao){
		super.setBaseDao(peopleRoleDao);
	}
	
	@Override
	public Boolean deleteBatch(List<Integer> ids) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public PeopleRole add(PeopleRole entity) {
		peopleRoleDao.save(entity);
		return get(entity.getId());
	}

	@Override
	public PeopleRole update(PeopleRole entity) {
		peopleRoleDao.update(entity);
		return get(entity.getId());
	}

	@Override
	public List<RoleInfo> findRoleByPeoId(Integer peoId){
		return peopleRoleDao.findRoleByPeoId(peoId);
	}
}
